<template>
  <div class="communityOrderView pd-20">
    <div class="detailView">
      <div class="detail">
        <div class="name">检测项目</div>
        <div class="value">{{item.checkName}}</div>
      </div>
      <div class="detail">
        <div class="name">金额</div>
        <div class="value">{{item.money}}元</div>
      </div>
      <div class="detail">
        <div class="name">检测医生</div>
        <div class="value">{{item.dname}}</div>
      </div>
      <div class="detail">
        <div class="name">患者姓名</div>
        <div class="value">{{item.name}}</div>
      </div>
      <div class="detail">
        <div class="name">患者性别</div>
        <div class="value"
             v-if="item.sex === 1">男</div>
        <div class="value"
             v-else>女</div>
      </div>
      <div class="detail">
        <div class="name">患者年龄</div>
        <div class="value">{{Math.floor(commonFunction.checkAge(item.age, item.createTime))}}</div>
      </div>
      <div class="detail">
        <div class="name">状态</div>
        <div class="value">{{item.status ? '已解读' : '未解读'}}</div>
      </div>
      <div class="detail">
        <div class="name">解读结果</div>
        <div class="value">{{item.content}}</div>
      </div>
      <p align="center"
         class="mt-20 goPage">
        <Button type="primary"
                @click="goPage">返 回</Button>
      </p>
    </div>
  </div>
</template>

<script>
  export default {
    name: "communityOrderView",
    data () {
      return {
        item: {},
      }
    },
    mounted () {
      this._getViewById()
    },
    methods: {
      _getViewById () {
        this.ajax({
          type: this.api.communityOrderView.type,
          url: this.api.communityOrderView.url,
          data: {
            id: this.$route.query.id
          },
          success: (data) => {
            this.item = data.object
            this.$previewRefresh()
          },
          error: (data) => {
            this.$Message.error(data.message);
          }
        })
      },
      goPage () {
        this.$router.push({ name: 'communityOrderMgt' })
      }
    },
    filters: {
    }
  }
</script>

<style lang="scss" type="text/scss" rel="stylesheet/scss">
  .communityOrderView {
  }
  .goPage {
    padding-bottom: 20px;
  }
</style>
